﻿using System;
using System.Collections.Generic;
using System.Linq;
using Autodesk.Revit.DB;

namespace YJKRevitKernel.FaceCalculateUtility
{
	public class SolidFaceCalculateManager : BaseCalculateManager
	{
		public List<SolidPacker> LstSolidPacker
		{
			get
			{
				return this.m_lstSolid;
			}
			private set
			{
				this.m_lstSolid = value;
			}
		}

		public SolidFaceCalculateManager(Dictionary<Solid, object> inputSolid, uint nXDirectionNumber = 1u, uint nYDirectionNumber = 1u, uint nZDirectionNumber = 1u)
		{
			if (inputSolid == null)
			{
				inputSolid = new Dictionary<Solid, object>();
			}
			this.LstSolidPacker = (from n in inputSolid
			select new SolidPacker(n.Key, n.Value)).ToList<SolidPacker>();
			base.LstAllInputFace = new List<PlanarFacePacker>();
			foreach (SolidPacker solidPacker in this.LstSolidPacker)
			{
				base.LstAllInputFace.AddRange(solidPacker.ThisLstFace);
			}
			BaseCalculateManager.ResetNumber(ref nXDirectionNumber);
			BaseCalculateManager.ResetNumber(ref nYDirectionNumber);
			BaseCalculateManager.ResetNumber(ref nZDirectionNumber);
			this.m_useFaceGroupHandler = new FaceGroupHandler(this.LstSolidPacker.Cast<BasePacker>().ToList<BasePacker>(), (int)nXDirectionNumber, (int)nYDirectionNumber, (int)nZDirectionNumber);
		}

		private List<SolidPacker> m_lstSolid;
	}
}
